fix: restrict docs-preview workflow to actual docs changes#515
fix: restrict docs-preview workflow to actual docs changes#515andreatgretel merged 3 commits intomainfrom
Conversation
The docs-preview workflow triggered on all source code changes due to the broad `packages/*/src/data_designer/**` path glob. This caused unnecessary Cloudflare Pages deployments on code-only PRs like #505. Remove the source code path filter so the workflow only triggers on actual docs content changes (docs/**, mkdocs.yml, and the workflow file itself).
Greptile SummaryRemoves the
|
| Filename | Overview |
|---|---|
| .github/workflows/docs-preview.yml | Removes packages/*/src/data_designer/** from path triggers; correct intent but over-broad — mkdocstrings-generated API reference pages are still sourced from those directories. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
PR[Pull Request opened / synchronized] --> PathCheck{Path filter match?}
PathCheck -->|docs/** changed| Trigger[Run docs-preview workflow]
PathCheck -->|mkdocs.yml changed| Trigger
PathCheck -->|.github/workflows/docs-preview.yml changed| Trigger
PathCheck -->|packages/ source changed ONLY| Skip[Workflow skipped]
Trigger --> Build[Build MkDocs site]
Build --> Deploy[Deploy to Cloudflare Pages]
Deploy --> Comment[Post preview URL comment on PR]
Skip --> NoPreview[No preview generated]
style Skip fill:#f96,color:#000
style NoPreview fill:#f96,color:#000
Prompt To Fix All With AI
This is a comment left during a code review.
Path: .github/workflows/docs-preview.yml
Line: 3-9
Comment:
**Source-code docstring changes no longer trigger a preview**
`mkdocs.yml` configures `mkdocstrings` to render the entire **Code Reference** section directly from docstrings in `packages/*/src/data_designer/**`, and its `watch` block lists the same paths. A PR that only updates a docstring, adds a new public class, or renames a parameter will no longer receive a Cloudflare preview, so reviewers won't be able to inspect the rendered API reference change in the PR.
Consider re-adding a narrower path that targets only the source files most likely to affect rendered output, for example:
```yaml
- "packages/*/src/data_designer/**/*.py"
```
That still prevents the broader infra/test churn from triggering previews while keeping the mkdocstrings-backed pages covered.
How can I resolve this? If you propose a fix, please make it concise.Reviews (3): Last reviewed commit: "Merge branch 'main' into andreatgretel/f..." | Re-trigger Greptile
|
Docs preview: https://e651afbe.dd-docs-preview.pages.dev
|
Review: PR #515 — fix: restrict docs-preview workflow to actual docs changesSummaryThis single-line PR removes the Changed files: 1 ( Findings1. [Medium] Docs build depends on source code via mkdocstringsThe - mkdocstrings:
handlers:
python:
paths:
- packages/data-designer-config/src
- packages/data-designer-engine/src
- packages/data-designer/srcThere are 12+ API reference pages in This means a contributor changing a public API surface (renaming a parameter, updating a docstring, removing a class) will not get a docs preview showing the impact on the published reference docs. The previous broad filter was over-inclusive (it fired on any source change, not just public API changes), but removing it entirely swings to under-inclusive. Suggestion: Consider a narrower filter that still covers the API-surface files. For example: - "packages/*/src/data_designer/**/config_builder.py"
- "packages/*/src/data_designer/**/column_configs.py"
- "packages/*/src/data_designer/config/**"Or accept the trade-off and document that contributors should manually trigger a docs preview (or check locally) when changing public APIs. 2. [Low] No follow-up for local docs verification guidanceThe PR description's test plan covers CI trigger behavior but doesn't mention updating contributor docs (e.g., DEVELOPMENT.md or CONTRIBUTING.md) to note that source-code changes affecting API docs now require manual 3. [Info] The change itself is correct and safeThe YAML syntax is valid. The remaining path filters ( VerdictApprove with comment. The change is correct for its stated goal (stop code-only PRs from triggering docs builds) and is low-risk. However, the |
📋 Summary
The docs-preview workflow had an overly broad path filter (
packages/*/src/data_designer/**) that triggered on every source code change. This caused unnecessary Cloudflare Pages deployments on code-only PRs (e.g. #505) where no docs content changed.🔗 Related Issue
N/A
🔄 Changes
packages/*/src/data_designer/**path filter from thedocs-preview.ymlworkflow triggerdocs/**,mkdocs.yml, or the workflow file itself changes🧪 Testing
make testpasses - N/A, no testable logicdocs/✅ Checklist